<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title th:text="${lic.company} + '系统安装'"></title>
    <link rel="stylesheet" type="text/css" th:href="@{'/common.css'}">
    <link type="text/css" rel="stylesheet" th:href="@{/skin/lte/css.css}" />
    <link rel="stylesheet" th:href="@{/js/layui/css/layui.css}" media="all">
    <link th:href="@{/js/jquery-showLoading/showLoading.css}" rel="stylesheet" type="text/css"/>
    <style>
        table img {
            vertical-align: center;
            margin-top: 9px;
        }

        table td {
            height: 34px;
        }
    </style>
    <script th:src="@{/inc/common.js}"></script>
    <script th:src="@{/js/jquery-1.9.1.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/layui/layui.js}" charset="utf-8"></script>
    <script th:src="@{/js/jquery-showLoading/jquery.showLoading.js}" type="text/javascript"></script>
</head>
<body>
<!--<div th:replace="th/setup/setup_config_sys :: setupConfigSys(1)"></div>-->
<table cellpadding="6" cellspacing="0" border="0" width="100%" style="margin-top:20px">
    <tr>
        <td width="1%" valign="top"></td>
        <td width="99%" valign="top">
            <div align="left"><b><span th:text="${lic.company}"></span>，欢迎您使用，版本<span th:text="${oaVersion}"></span></b></div>
            <hr size="0">
            在安装继续进行前，您的服务器环境必须通过以下所有检查:
            <ul>
                <table border="0">
                    <tr>
                        <td valign=top><img src="images/check.gif" width="13" height="13"></td>
                        <td>
                            安装工具检测到你正运行在 <span th:text="${serverInfo}"></span>
                        </td>
                    </tr>
                    <th:block th:if="${isJdk18}">
                        <tr>
                            <td valign=top><img src="images/check.gif" width="13" height="13"></td>
                            <td>
                                你的JDK版本为1.8或者更新。
                            </td>
                        </tr>
                    </th:block>
                    <th:block th:unless="${isJdk18}">
                        <tr>
                            <td valign=top><img src="images/x.gif" width="13" height="13"></td>
                            <td>
                                您的JDK版本好像低于JDK 1.6。因此安装不能继续。如果可能，请更新JDK版本并重新开始这个过程。
                            </td>
                        </tr>
                    </th:block>

                    <th:block th:if="${filePrepare}">
                        <tr>
                            <td valign=top><img src="images/check.gif" width="13" height="13"></td>
                            <td>
                                所有的应用程序包都安装正确。
                            </td>
                        </tr>
                    </th:block>

                    <th:block th:unless="${filePrepare}">
                        <tr>
                            <td valign=top><img src="images/x.gif" width="13" height="13"></td>
                            <td>
                                一个或者多个应用程序包没有被安装。
                            </td>
                        </tr>
                    </th:block>

                    <tr>
                        <td colspan="2" valign=top>
                            <ul>
                                <img th:src="${jdbcExtInstalled ? 'images/check.gif' : 'images/x.gif'}" width="13"
                                     height="13">
                                工作流内核
                                <br>
                                <img th:src="${javaMailInstalled ? 'images/check.gif' : 'images/x.gif'}" width="13"
                                     height="13">
                                JavaMail支持 (mail.jar, activation.jar,)
                                <br>
                                <img th:src="${jdbcExtInstalled ? 'images/check.gif' : 'images/x.gif'}" width="13"
                                     height="13">
                                JDBC 2.0 扩展 (jdbc2_0-stdext.jar)
                            </ul>
                        </td>
                    </tr>

                    <th:block th:if="${!propError}">
                        <tr>
                            <td valign=top><img src="images/check.gif" width="13" height="13"></td>
                            <td>
                                系统目录正确配置于: <span th:text="${cfgPath}"></span>
                            </td>
                        </tr>
                    </th:block>

                    <th:block th:unless="${!propError}">
                        <tr>
                            <td valign=top><img src="images/x.gif" width="13" height="13"></td>
                            <td th:text="${errorMessage}"></td>
                        </tr>
                    </th:block>

                    <tr>
                        <td valign=top><img src="images/check.gif" width="13" height="13"></td>
                        <td><b>您的缓存已清除，配置信息已更新。</b></td>
                    </tr>
                </table>
            </ul>

            <th:block th:if="${check}">
                <b>安装初始化检查过程中发现错误，请更正，然后重新启动服务器重新开始安装过程。</b>
            </th:block>

            <th:block th:unless="${check}">
                <form id="form1" method="post">
                    请选择数据库类型：&nbsp;&nbsp;&nbsp;
                    <!--<input id="oadb" name="oadb" value="mysql" type="hidden"/>-->
                    <select id="oadb" name="oadb">
                        <option value="">请选择数据库类型</option>
                        <option th:value="${dbType}" selected="selected">MYSQL</option>
                        <option th:value="${dbType}" selected="selected">PostGreSql</option>
                        <!--<option value="mssql">SQLServer2000</option>
                        <option value="oracle">Oracle</option>-->
                    </select>
                    <script th:inline="javascript">
                        o("oadb").value = [[${dbType}]];
                    </script>
                    <hr size="0">
                    <div align="center">
                        <!--              <input id="btnLogin" class="btn" type="button" value="登录" onclick="window.location.href='<%=request.getContextPath()%>/index.do'" />-->
<!--                        <input id="btnLogin" class="btn" type="button" value="登录"-->
<!--                               th:onclick="window.location.href='[(${contextpath})]/index'"/>-->
                        &nbsp;&nbsp;
                        <input class="btn" type="button" value="许可证" th:onclick="window.location.href='[(${contextpath})]/setup/license'"/>
                        &nbsp;&nbsp;
                        <input class="btn" type="button" value="数据字典" th:onclick="window.location.href='[(${contextpath})]/setup/dataDict'"/>
                        &nbsp;&nbsp;
                        <input class="btn" id="btnSubmit" type="submit" value="下一步"/>
                    </div>
                </form>
            </th:block>
        </td>
    </tr>
</table>

</body>
<script th:inline="javascript">
    $('#btnSubmit').click(function (e) {
        e.preventDefault();

        window.location.href = 'setup2';
        return;

        $.ajax({
            type: "post",
            url: "selectDb",
            data: {
                db: $('#oadb').val(),
            },
            dataType: "json",
            beforeSend: function (XMLHttpRequest) {
                $('body').showLoading();
            },
            success: function (res, status) {
                layer.alert(res.msg, {
                    yes: function () {
                        window.location.href = "setup2";
                    }
                });
            },
            complete: function (XMLHttpRequest, status) {
                $('body').hideLoading();
            },
            error: function () {
                alert(XMLHttpRequest.responseText);
            }
        });

    })
</script>
</html>